package is1;

public class Fecha implements Comparable<Fecha>
{
	public enum Dia {Lunes, Martes, Miercoles, Jueves, Viernes, Sabado, Domingo};
	
	Dia d;
	int hora;
	int min;
	
	public Fecha(Dia d, int hora, int min)
	{
		super();
		this.d = d;
		this.hora = hora;
		this.min = min;
	}

	public Dia getD()
	{
		return d;
	}

	public int getHora()
	{
		return hora;
	}

	public int getMin()
	{
		return min;
	}

	@Override
	public int compareTo(Fecha o)
	{
		if (this.d.ordinal() > o.d.ordinal() )
		{
			return 1;
		}
		if (this.d.ordinal() < o.d.ordinal() )
		{
			return -1;
		}
		if (this.hora > o.hora)
		{
			return 1;
		}
		if (this.hora < o.hora)
		{
			return -1;
		}
		if (this.min > o.min)
		{
			return 1;
		}
		if (this.min < o.min)
		{
			return -1;
		}
		return 0;
	}
	
	
}
